<!DOCTYPE html>
<html lang="en">
<head>
    <title>销售绩效考核报表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <style>
        .moduleName {
            height: 28px;
            line-height: 28px;
            font-size: 22px;
            border-bottom: 1px solid #ddd;
            text-align: left;

        }

        .oaReportNav {
            padding: 0;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            padding: 10px 0;
            margin-bottom: 0px;
            box-shadow: none;
            position: relative;
            overflow: hidden;

        }

        .infoReport {
            display: flex;
            justify-content: flex-start;
            text-align: left;
            margin-left: 10px;
        }

        .infoReport div {
            margin: 0 10px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;

        }

        .lineOneNoMore {
            text-align: left;
        }

        .lineOneNoMore span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
        }

        .imgStyle {
            width: 300px;
            height: 400px;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .templateStyle {
            border: 1px solid #ddd;
            padding: 0 10px;
        }

        .table > thead > tr > th {
            padding: 0;
        }

        .table > tbody > tr > td {
            position: relative;
        }

        .selectBox {
            height: 25px;
            margin-bottom: 10px;
        }

        .lineOne {
            text-align: center;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: center;
        }

        .left {
            width: 180px;
            float: left;
        }

        .right {
            margin-left: 190px;
        }

        .boxItem {
            position: relative;
        }

        .boxItemTitleNotice {
            color: red;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 10px;
            text-align: center;
        }

        .boxItemTitleNotice i {
            background: url("/dist/img/jg.png") no-repeat center center;
            height: 16px;
            width: 16px;
            background-size: cover;
            display: inline-block;
            margin-bottom: -3px;
            margin-left: 5px;
        }

        .boxItemTitle {
            color: #2c8cec;
            font-size: 22px;
            font-weight: bold;
            margin-bottom: 6px;
            text-align: center;
        }

        .home {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 10px;
            height: 14px;
            line-height: 14px;
            text-align: center;
        }

        .weather {
            text-align: center;
            font-size: 16px;
            position: absolute;
            right: 10px;
            top: 9px;
            line-height: 30px;
        }

        .blue {
            color: #39c;
        }

        .red {
            color: #e03800;
        }

        .weather img {
            height: 30px;
            width: 30px;
            float: left;
        }

        .tdColor {
            background-color: #f8f8f8;
            font-weight: bold;
        }

        .lineImg {
            text-align: left !important;
            padding: 5px !important;
        }

        .lineImg img {
            vertical-align: middle;
            width: 100px;
            height: 100px;
        }

        .lineTwo span {
            max-height: 38px;
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            text-align: left;
        }

        .jiaobiao, .jiaobiaoNew {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 20px 20px;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .jiaobiaoNew i {
            display: block;
            width: 20px;
            height: 20px;
            background: url("/dist/img/newLog2.png");
            background-size: 100% 100%;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .table {
            margin-bottom: 0;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<div class="div-td-content-more"><i></i></div>
<section class="content" id="app" v-cloak>
    <iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
    <div class="row">
        <div class="left" id="inboxGroup"  v-if="getCurrentUser.roleName!='区域经理'">
            <div class="box-body no-padding box-border iframeH" style="overflow: auto;background: #f7f8fa;">
                <ul class="ztree" id="ztree"></ul>
            </div>
        </div>
        <div :class="getCurrentUser.roleName!='区域经理'?'right':''" id="divMiddle">
            <div class="templateStyle iframeH" style="overflow-y: auto">
                <div class="nav-tabs-custom oaReportNav">
                    <!-- Tabs within a box -->
                    <!-- <input type="text" @focus="showDatePicker2($event)" v-model="time" style="width:124px;float: left;  height: 28px; margin-bottom: 10px;">
                     <input type="button" style="margin-left:10px;margin-top: 2px;width: 60px" class="btn oaBtn btn-sm pull-left" value="导出"
                            @click="exportExcel()" >
                     <div class="moduleName" >销售绩效考核报表({{time}})</div>
               -->
                    <ul class="nav nav-tabs pull-right" v-cloak>
                        <li class="active" @click="refreshData(today)"><a href="#sales-chart"
                                                                          data-toggle="tab">今日</a>
                        </li>
                        <li @click="refreshData(thisMonth)"><a href="#sales-chart" data-toggle="tab">本月</a>
                        </li>
                    </ul>
                </div>
                <!--今日-->
                <template v-if="time==today">
                    <!--------------------------------------------------请假---------------------------------------------------->
                    <template v-if="sign.signState==1">
                        <div class="boxItem">
                            <div class="boxItemTitle">请假</div>
                            <div class="boxBoy" style="text-align: center">
                                <img src="/dist/img/qinjia.png" alt="" style="margin-top: 50px;margin-right: -30px;">
                                <div class="home" style="margin-top:100px;">{{sign.remark}}</div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </template>
                    <!--------------------------------------------------缺勤---------------------------------------------------->
                    <template v-else-if="sign.signState==2">
                        <div class="boxItem">
                            <div class="boxItemTitleNotice">缺勤</div>
                            <div class="boxBoy" style="text-align: center">
                                <img src="/dist/img/qinjia2.png" alt="" style="margin-top: 50px;margin-right: -30px;">
                                <div class="home" style="margin-top:100px;">{{sign.remark}}</div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </template>
                    <!--------------------------------------------------出勤---------------------------------------------------->
                    <template v-else>
                        <!--今日签到-->
                        <div class="boxItem">
                            <div class="nav-tabs-custom oaReportNav">
                                <div class="moduleName">考&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;勤</div>
                                <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul>
                            </div>
                            <div class="weather" v-if="weather.text_day"><b
                                    style="margin: 0 2px;">{{weather.text_day}}</b><font
                                    class="blue">{{weather.low}}</font>～<font class="red">{{weather.high}}℃</font><img
                                    :src="'/dist/img/weather/'+weather.code_day+'.png'"></img></div>
                            <div class="boxBoy" style="line-height: 1">
                                <template v-if="sign">
                                    <img v-if="sign.signUrl" :src="sign.signUrl"
                                         alt="" style="width: 400px;display: block;margin:0 auto;margin-bottom: -10px">
                                    <img v-if="sign.signUrl" :src="sign.signOutUrl"
                                         alt="" style="width: 400px;display: block;margin:0 auto;margin-top: 10px;">
                                </template>
                            </div>
                        </div>
                        <!--今日面访-->
                        <div class="boxItem">
                            <div class="nav-tabs-custom oaReportNav">
                                <div class="moduleName">面&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;访</div>
                                <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul>
                            </div>
                            <div class="boxBoy">
                                <div v-if="visit.length<=0||!visit" style="text-align: center;color:#333;padding-bottom:5px;
 border-bottom:1px solid #ddd;">暂无面访记录
                                </div>
                                <table class="table table-bordered text-center table-width"
                                       v-for="(customer,i) in  visit">
                                    <tbody>
                                    <template
                                            v-if="customer.areaType=='1'&&customer.frontFlag=='1'&&customer.entourage!='无'">
                                        <tr>
                                            <td :class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'"
                                                style="width: 25%;">
                                                <i></i>陪同人
                                            </td>
                                            <td style="width: 25%;"><span>{{customer.entourage}}</span></td>
                                            <td class="tdColor" style="width: 25%;">拜访时长</td>
                                            <td style="width: 25%;"><span>{{customer.time}}分</span></td>
                                        </tr>
                                    </template>
                                    <template v-else>
                                        <tr>
                                            <td :class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'"
                                                style="width: 25%;"><i></i>客户姓名
                                            </td>
                                            <td>{{customer.name}}</td>
                                            <td class="tdColor" style="width: 25%;">客户电话</td>
                                            <td style="width: 25%;"><span>{{trims(customer.tel)}}</span></td>
                                        </tr>
                                        <tr>
                                            <td class="tdColor">客户微信</td>
                                            <td><span>{{trims(customer.wechat)}}</span></td>
                                            <td class="tdColor">陪同人</td>
                                            <td><span>{{customer.entourage}}</span></td>
                                        </tr>
                                        <tr>
                                            <td class="tdColor">客户类型</td>
                                            <td><span>{{customer.customerType?customer.customerType:"-"}}</span></td>
                                            <td class="tdColor">客户信用</td>
                                            <td><span>{{customer.customerCredit?customer.customerCredit:"-"}}</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="tdColor">拜访时间</td>
                                            <td>
                                                <span>{{customer.arrivalsTime?customer.arrivalsTime:"-"}}/{{customer.leaveTime?customer.leaveTime:"-"}}</span>
                                            </td>
                                            <td class="tdColor">拜访时长</td>
                                            <td><span>{{customer.time}}分</span></td>
                                        </tr>
                                    </template>
                                    <tr>
                                        <td class="tdColor">图片</td>
                                        <td class="lineImg" colspan="3">
                                            <img v-if="customer.leaveImg" :src="customer.leaveImg"
                                                 @click="openImg(customer.leaveImg)" style="cursor: pointer;">
                                        </td>

                                    </tr>
                                    <tr>
                                        <td class="tdColor">基本情况</td>
                                        <td colspan="3" class="lineTwo"><span>{{customer.otherCondition}}</span></td>
                                    </tr>
                                    <tr v-if="i==0">
                                        <td class="tdColor" colspan="3">考勤签到时间与拜访时间 时间间隔</td>
                                        <td>{{customer.timeInterval}}<i v-if="customer.remind=='1'"
                                                                        class="fa fa-question"
                                                                        style="color:red;font-size: 15px;margin-left: 2px;"></i>
                                        </td>
                                    </tr>
                                    <tr v-if="i==0">
                                        <td class="tdColor" colspan="3">考勤签到地点与拜访地点 距离间隔</td>
                                        <td>{{customer.distance}}</td>
                                    </tr>
                                    <tr v-if="i==0">
                                        <td class="tdColor" colspan="3">时速</td>
                                        <td>{{clearKil(customer.speed)}}</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </template>

                </template>
                <!--本月-->
                <template v-else>
                    <div class="boxItem">
                        <div class="nav-tabs-custom oaReportNav">
                            <div class="moduleName">考&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;勤</div>
                            <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul>
                        </div>
                        <table class="table table-bordered text-center table-width ">
                            <thead>
                            <tr>
                                <!--<th style="width: 5%;">序号</th>-->
                                <th style="width:120px">日期</th>
                                <th style="width: 80px">出勤</th>
                                <th style="width: 80px">签到时间</th>
                                <th  style="width: 80px">首次面访时间</th>
                                <th >距离(km)</th>
                                <th >时间差(分钟)</th>
                                <!-- <th style="width: 5%">签退时间</th>
                                 <th style="width: 44%">签退地点</th>-->
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                            <td>09-06</td>
                                <td><i class="fa fa-check" style="color:#349f2f;"></i></td>
                                <td>08:35</td>
                                <td>08:50</td>
                                <td>22.2</td>
                                <td>15</td>
                            </tr>
                            <tr>
                                <td>09-07</td>
                                <td><i class="fa fa-check" style="color:#349f2f;"></i></td>
                                <td>08:35</td>
                                <td>08:50</td>
                                <td>22.2</td>
                                <td>15</td>
                            </tr>
                            <tr>
                                <td>09-08</td>
                                <td><i class="fa fa-check" style="color:#349f2f;"></i></td>
                                <td>08:35</td>
                                <td>08:50</td>
                                <td>22.2</td>
                                <td>15</td>
                            </tr>
                            <!--<tr v-for="(item,i) in signList">-->
                                <!--<td>{{(item.signDate).substr(5,10)}}</td>-->
                                <!--<td>-->
                            <!--<span v-if="item.signState=='0'">-->

                                <!--<i class="fa fa-check" style="color:#349f2f;"></i>-->
                            <!--</span>-->
                                    <!--<span v-else-if="item.signState==1">-->
                            <!--请假-->
                        <!--</span>-->
                                    <!--<span v-else-if="item.signState==2">-->
                                <!--<i class="fa fa-close" style="color:red;"></i>-->
                            <!--</span>-->
                                <!--</td>-->
                                <!--<td v-if="item.signState==1">-->
                                    <!-- - -->
                                <!--</td>-->
                                <!--<td v-else>{{item.signCreateTime}}</td>-->
                                <!--<td style="text-align: left;" class="lineOneNoMore">-->
                        <!--<span v-if="item.signState=='0'" @click="openImg(item.signUrl)"-->
                              <!--style="color:#169BD5;cursor: pointer;">{{item.startAddress}}</span>-->
                                    <!--<span v-else-if="item.signState==1">{{item.startAddress}}</span>-->
                                <!--</td>-->

                            <!--</tr>-->
                            </tbody>
                        </table>
                    </div>
                    <div class="boxItem">
                        <div class="nav-tabs-custom oaReportNav">
                            <div class="moduleName">拜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;访</div>
                            <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul>
                        </div>
                        <table class="table table-bordered text-center table-width">
                            <thead>
                            <tr>
                                <th style="width: 120px">日期
                                </th>
                                <th >电访</th>
                                <th >面访</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr v-for="(item,i) in visitCustomerList">
                                <td>{{item.data}}</td>
                                <td v-if="item.complete!='-'" style="text-align:center;color:#169BD5;cursor: pointer"
                                    @click="lookInterview(item,'1')">{{item.completeFace}}
                                </td>
                                <td v-else>-</td>
                                <td v-if="item.complete!='-'" style="text-align:center;color:#169BD5;cursor: pointer"
                                    @click="lookInterview(item,'1')">{{item.completeTel}}
                                </td>
                                <td v-else>-</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </template>
            </div>
        </div>
    </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    var zTreeCallback = {
        showIcon: function (treeeId, treeNode) {
            return treeNode.isParent;
        },
        onClick: function (event, treeId, treeNode) {
            console.log(treeNode)
            app.userId = treeNode.id;
            app.getData();
        },
        beforeClick: function (treeId, treeNode, clickFlag) {
            if (treeNode.level == 0) {
                return false;
            }
        }
    };
    var zTreeSetting = {
        view: {
            showIcon: zTreeCallback.showIcon
        },
        data: {
            simpleData: {
                enable: true
            },
            keep: {
                parent: true
            }
        },
        callback: {
            onClick: zTreeCallback.onClick,
            beforeClick: zTreeCallback.beforeClick
        }
    };

</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            getCurrentUser:getCurrentUser(),
            visit: [],
            today: new Date().Format("yyyy-MM-dd"),//今天
            hour: new Date().getHours(),
            thisMonth: new Date().Format("yyyy-MM"),
            time: new Date().Format("yyyy-MM-dd"),
            userId:getCurrentUser().id,
            weather: {},
            signList: [],
            sign: {
                list: [],
                info: {}
            },
            wechat: {
                time: new Date().Format("yyyy-MM-dd"),
                list: [],
                reportShare: {Forward: 0, FinishForward: 0, NoForward: 0}
            },
            visitCustomerList:[{
                "averageComplete": 8.05,
                "completeFace": 145,
                "completeTel": 145,
                "completionRate": 86.3,
                "regionId": "2018070509164939BDB66AC007AC57DB",
                "regionName": "庄河市、长海县、大连开发区",
                "rownum": "1",
                "signManagerNum": 18,
                "data": '09-08',
                "userId": "201712162102405E8805B8C4998C55B5",
                "userName": "谭财田"
            }],

        },
        methods: {
            //去空格
            trims: function (data) {
                console.log(data);
                var data = data.replace(/[ ]/g, "");
                return data;
            },
            //处理时速取整
            clearKil: function (data) {
                var data = data.replace("公里/小时", "");
                data = Math.ceil(Number(data));
                return data + "公里/小时";
            },
            //格式化日期
            insert_flg: function (str, flg, sn, type) {
                var newstr = "";
                for (var i = 0; i < str.length; i += sn) {
                    var tmp = str.substring(i, i + sn);
                    newstr += tmp + flg;
                }
                newstr = newstr.substr(0, newstr.length - 1);
                var st1 = newstr.substr(2, 2);
                var st2 = newstr.substr(5, 2);
                var newstr3 = st2 + "/" + st1;
                var obj = {str: newstr, time: newstr};
                return obj;
            },

            //tab中点击日期刷新对应数据
            refreshData: function (time) {
                var that = this;
                // that[dataType].dateTime = time;
                that.time = time;
                console.log(that.time)
                that.getData();
            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += Number(arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)
                    if (key == "monthMoney") {
                        console.log(arr[i][key])
                    }
                }
                return number;
            },

            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //查看签到、签退相片
            openImg: function (url) {
                top.$.dialog({
                    title: '图片详情',
                    content: 'url:/page/showImg.html?url=' + url,
                    height: 500,
                    max: true,
                    min: false,
                    lock: true
                }).max();
            },
            //获取天气
            get_weather: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.other.getTheWeather, {
                    "lat": that.sign.latitude,
                    "lng": that.sign.longitude
                }, function (data) {
                    that.weather = data.weather[0];
                    console.log(that.weather);
                });
            },
            //获取考勤信息
            get_signInPersonal: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.attendance.getSignPersonByToday, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    that.sign = data;
                    that.get_weather();
                });
            },
            //获取签到报表-区域经理-本月
            get_signInPersonalMonth: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.attendance.getForPersonalByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.time
                }, function (data) {
                    that.signList = data;
                    console.log(that.signList);
                });
            },
            //获取面访详情-区域经理
            get_visitPersonal: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.report.visitCustomer.getForPersonalDayByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.today
                }, function (data) {
                    that.visit = data;
                    console.log(that.visit)
                });
            },
            //查看拜访详情
            lookInterview: function (item, type) {
                var that = this;
                url = "reportForm/interview/interviewCustomerList.html";
                top.closeTabByPageId("bfkh-company");
                top.addTabs({
                    id: "bfkh-company",
                    title: '拜访客户列表',
                    close: true,
                    url: url + '?userId=' + item.userId + "&dateTime=" + that.time + "&name=" + item.userName + "&type=" + type
                });
            },
            getTreeData: function () {
                var that = this;
                $.wyui.postMethod('/allCustomerReport/reportDayTree.json', {
                    userId: getCurrentUser().id
                }, function (nodes) {
                    console.log(nodes)
                    for (var i = 0; i < nodes.length; i++) {
                        if (nodes[i].name == '重庆迎风') {
                            nodes.splice(i, 1);
                        }
                    }

                    that.treeObj = $.fn.zTree.init($("#ztree"), zTreeSetting, nodes);
                    var getNode = that.treeObj.getNodeByParam('type', 'user', null);
                    if (getNode) {
                        that.treeObj.selectNode(getNode);
                        that.userId = getNode.id;
                        that.getData();
                    }
                });
            },
            getData: function () {
                var that = this;
                //今日
                if (that.time == that.today) {
                    this.get_signInPersonal();
                    this.get_visitPersonal();
                } else {
                    this.get_signInPersonalMonth();
                }
                //本月
            }
        },
        mounted: function () {
            var that = this;
            //1.获取前5个月的tab数据
            that.getTreeData();
        }
    });

</script>

</body>
</html>